package com.zuo.demo01.service.impl;


import com.zuo.demo01.dao.LinkMapper;
import com.zuo.demo01.pojo.Links;
import com.zuo.demo01.service.LinkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;

@Service
public class LinkServiceImpl implements LinkService {

    @Autowired
    private LinkMapper linkMapper;

    @Override
    public List<Links> findAll(Map<String, Integer> map) {
        return linkMapper.findAll(map);
    }

    @Override
    public List<Links> getAll() {
        return linkMapper.getAll();
    }

    @Override
    public int count() {
        return linkMapper.count();
    }

    @Override
    public int insert(Links links) {
        Date date = new Date(System.currentTimeMillis());
        links.setCreateTime(date);
        return linkMapper.insert(links);
    }

    @Override
    public int delete(int id) {
        return linkMapper.delete(id);
    }

    @Override
    public int update(Links links) {
        return linkMapper.update(links);
    }


}
